-
Notifications
You must be signed in to change notification settings - Fork 39
chore: update tsconfig target #712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
BridgeAR
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a very good idea and I am in strong favor of this!
(Not only because of the name, but also because of the change ;-) )
That aside: it should be checked what runtimes are supported. Lambda currently supports Node.js 20 as lowest version, if I am not mistaken (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). That supports ES2023.
tsconfig.json
Outdated
| /* Basic Options */ | ||
| // "incremental": true, /* Enable incremental compilation */ | ||
| "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, | ||
| "target": "es2017" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node.js 18 supports ES2021 and that is already an outdated version. I think we should target nothing less than ES2020, if not 2021.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I set "es2021" to match the list of supported engines in the README.md
|
@rubenpad do you mind rebasing the PR after activating commit signing? We may not merge any unsigned commits (a merge therefore also does not resolve that, the current existing commits on the branch must be signed) |
491e833 to
e052e0d
Compare
Hey, @BridgeAR! No problem. I have updated the PR with signed commits. Thanks for the guidance! |
Hey! This is my first PR to this project. Please let me know if I did something wrong in the process. Thanks!
What does this PR do?
This PR updates the tsconfig target to at es2017.
Motivation
For tsconfig targets below es2017 the async/await syntax is compiled to the generator-based syntax with the __awaiter / __generator helpers. This change reduce the output size and improves the runtime performance.
Testing Guidelines
I ran the tests suite.
Additional Notes
After switching the TypeScript target to es2017, let declarations are preserved instead of being downleveled to var. This exposes correct block-scoping and temporal dead zone (TDZ) behavior that was previously masked by hoisting.
Some tests relied on the old hoisted behavior, so they have been updated to avoid accessing let variables before initialization. These changes align the test suite with real ES2017 runtime semantics without altering the intent of the tests.
Types of Changes
Check all that apply